package com.market.options.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.market.options.dao.OptionsDao;
import com.market.options.domain.OptionsCommand;

@Controller
public class OptDeleteController {
	@Autowired
	OptionsDao optionsDao;

	@RequestMapping(value="/optionsDelete.do",method=RequestMethod.GET)
	public String process(@RequestParam("o_code")int o_code,
			@RequestParam("c_code") int c_code,
			@RequestParam("p_code") int p_code,
			@RequestParam("pageNum") int pageNum,
			@RequestParam("searchMarket") String searchMarket,
			@RequestParam("searchCategory") String searchCategory){		
		System.out.println(o_code+"나옴?");
		try{
			optionsDao.delete(o_code);
		}catch(Exception e){
			e.printStackTrace();
		}		
		return "redirect:/productDetail.do?p_code="+p_code+"&c_code="+c_code+"&pageNum="+pageNum+"&searchMarket="+searchMarket+"&searchCategory="+searchCategory;
	}
}
